package com.dodoke.ojserver.bean.dto;

import com.dodoke.ojserver.bean.valid.ProblemValidGroups;
import com.dodoke.ojserver.common.Difficulty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

@Data
@ApiModel(description = "问题新增数据传输对象")
public class ProblemAddDTO {
    @ApiModelProperty(value = "问题编号")
    @Null(message = "问题编号必须为空", groups = { ProblemValidGroups.Add.class })
    @NotNull(message = "问题编号不能为空", groups = { ProblemValidGroups.Edit.class })
    private Integer problemId;

    @ApiModelProperty(value = "问题标题", required = true)
    @NotNull(message = "标题不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private String title;

    @ApiModelProperty(value = "问题描述", required = true)
    @NotNull(message = "描述不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private String description;

    @ApiModelProperty(value = "输入描述", required = true)
    @NotNull(message = "输入描述不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private String input;

    @ApiModelProperty(value = "输出描述", required = true)
    @NotNull(message = "输出描述不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private String output;

    @ApiModelProperty(value = "输入样例", required = true)
    @NotNull(message = "输入样例不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private String sampleInput;

    @ApiModelProperty(value = "输出样例", required = true)
    @NotNull(message = "输出样例不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private String sampleOutput;

    @ApiModelProperty(value = "问题提示", required = true)
    @NotNull(message = "提示不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private String[] hint;

    @ApiModelProperty(value = "问题来源", required = true)
    @NotNull(message = "来源不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private String source;

    @ApiModelProperty(value = "时间限制", required = true)
    @Min(value = 0, message = "时间不能小于0", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private Double timeLimit;

    @ApiModelProperty(value = "内存限制", required = true)
    @Min(value = 0, message = "内存不能小于0", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private Integer memoryLimit;

    @ApiModelProperty(value = "状态：发布1 隐藏0 删除-1", required = true)
    @NotNull(message = "状态不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private Integer status;

    @ApiModelProperty(value = "难度：简单EASY 一般COMMON 困难HARD", required = true)
    @NotNull(message = "难度不能为空", groups = { ProblemValidGroups.Add.class, ProblemValidGroups.Edit.class })
    private Difficulty difficulty;
}
